Add hooks to enable TX debugging#2574
Conversation
|
cc @bitwalker |
|
Could you add a description or link an issue where we can find information about what the goal of the PR is? It is hard to review the changes or judge alternatives without this information. |
|
@PhilippGackstatter @bobbinth This PR makes it possible for us to debug programs executed by the transaction kernel, which is a big improvement in DX. I'd like to try and get this released as part of the v0.22 release cycle/upcoming testnet - just let me know if you need anything on our end to make that go smoothly. |
|
@djolertrk Looks like a couple lint checks failed |
bobbinth
left a comment
There was a problem hiding this comment.
Thank you! Not a review yet - but a couple of high-level comments:
- It seems like this PR includes a lot of extraneous changes (e.g., from the AggLayer crate). Could we remove them? (these changes will land soon as a part of #2546)
- It would be great to provide a bit more detail about the goal here. After a brief look, my understanding is that we are trying to control how
FastProcessoris instantiated, but I don't yet have full understanding of how this will be used in the compiler. I'm mostly trying to understand if theTransactionProgramFactorypattern is really needed here or if we can do something simpler (e.g., maybe adding a generic type to theTransactionExecutorwould suffice).
Also, I wonder if there may be some overlap with #2293 (though, maybe not).
@bobbinth Thanks for the comments! Yes, it does overlap with the #2546 (the AggLayer changes for example), but I needed those so I can test the feature end to end. But yes, if the PR will land soon, I can just rebase on top of it -- so I am doing it. The immediate consumer here is the debugger, not the compiler. The goal is to let @PhilippGackstatter I've updated PR description as well. |
917ffe3 to
6a5bc19
Compare
|
note: Rebased on top of #2546. |
6a5bc19 to
27c1fea
Compare
|
note: now rebased on top of |
|
@djolertrk I think we've landed on our plan for how to proceed with this. If you can rebase on the latest changes in next, and make the switch to a single trait vs factory + executor traits, I believe this should be basically ready to merge. |
Yes. I agree. Let's do it that way (I was already on it -- doing some final testing). |
27c1fea to
d1e99cf
Compare
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you. I left some comments inline.
|
@bobbinth Thank you for the comments! |
|
This can be merged, right? :) @bobbinth @bitwalker |
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me!
I think we can pass the exec options initialized by TransactionExecutor in the places I mentioned, after that, I think we can merge.
@PhilippGackstatter thank you for the feedback! |
|
I guess it is ready now :) |
bobbinth
left a comment
There was a problem hiding this comment.
All looks good! Thank you!
|
@djolertrk - this is good to merge but the branch needs to be updated (and I can't update it myself for some reason). Could you merge the latest |
Head branch was pushed to by a user without write access
7e6da88 to
1c27015
Compare
Done :) Yeah, the reason is that I used fork. |
|
@djolertrk Could you update to next again? Some PRs were merged in the meantime. |
1c27015 to
2e07233
Compare
|
@PhilippGackstatter done :) |
This PR adds a small hook to the transaction execution path so that the program runner used by
midentx::TransactionExecutorcan be swapped out while preserving the existing transaction preparation/execution pipeline.The motivation is debugger support and better developer tooling. We want to be able to debug programs executed under the transaction kernel, instead of only debugging standalone VM programs. In practice, this lets downstream tooling swap in a custom executor that:
while still reusing the existing
TransactionExecutorlogic for transaction preparation, host setup, note handling, foreign account loading, etc.The default behavior is unchanged:
TransactionExecutorstill usesFastProcessorby default.